﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;

namespace QuanLyDaiLy.Model
{
    [Table(Name="DaiLy")]
    public class CDaiLy
    {
 
        #region Properties
        [Column(Name = "MaDaiLy", IsPrimaryKey = true)]
        public int MaDaiLy { get; set; }

        [Column(Name = "MaLoaiDaiLy")]
        public int MaLoaiDaiLy { get; set; }

        [Column(Name = "TenDaiLy")]
        public string TenDaiLy { get; set; }

        [Column(Name = "DienThoai")]
        public string DienThoai { get; set; }

        [Column(Name = "DiaChi")]
        public string DiaChi { get; set; }

        [Column(Name = "MaQuan")]
        public int MaQuan { get; set; }

        [Column(Name = "NgayTiepNhan")]
        public DateTime NgayTiepNhan { get; set; }

        [Column(Name = "Email")]
        public string Email { get; set; }

        [Column(Name = "TienNo")]
        public int TienNo { get; set; }
        #endregion

        #region Constructor
        public CDaiLy()
        { }

        public CDaiLy(int maloaidaily, string tendaily, string diachi, int maquan, string sodienthoai,DateTime ngaytiepnhan, string email, int tienno)
        {
            Initialize(maloaidaily, tendaily, diachi, maquan, sodienthoai, ngaytiepnhan, email, tienno);
        }

        public CDaiLy(int madaily, int maloaidaily, string tendaily, string diachi, int maquan, string sodienthoai, DateTime ngaytiepnhan, string email, int tienno)
        {
            Initialize(maloaidaily, tendaily, diachi, maquan, sodienthoai, ngaytiepnhan, email, tienno);
            this.MaDaiLy = madaily;
        }

        public void Initialize(int maloaidaily, string tendaily, string diachi, int maquan, string sodienthoai, DateTime ngaytiepnhan, string email, int tienno)
        {
            this.MaLoaiDaiLy = maloaidaily;
            this.TenDaiLy = tendaily;
            this.DiaChi = diachi;
            this.MaQuan = maquan;
            this.DienThoai = sodienthoai;
            this.NgayTiepNhan = ngaytiepnhan;
            this.Email = email;
            this.TienNo = tienno;
        }
        #endregion
    }
}
